If setPos worked, the following code should put a dialog box at the top left of the screen, but it doesn't do that and placement doesn't seem to be related to the coordinates in the setPos() call. Anyone know why? |
Re: Why doesn't setPos() work to position a dialog box? AAI Services, Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
Re: Why doesn't setPos() work to position a dialog box? dpechacek - Wed Apr 08 08:42:52 EDT 2009 OK, wait - I didn't know about the realize() function. But it STILL does not work: DB dB=topMost "hello world" setPos(dB,0,0) label(dB,"Why?") realize dB setPos(dB,0,0) show dB Although the above does not work, replacing the last 3 lines with this DOES work: realize (dB,0,0) show dB So I've found a solution to my problem (thank you), but it still appears that setPos doesn't work. Regards, Strathglass |
Re: Why doesn't setPos() work to position a dialog box? strathglass - Wed Apr 08 08:59:05 EDT 2009
Interesting. DB dB=topMost "hello world" label(dB,"Why?") realize(dB) set(dB,0,0) show dB
|
Re: Why doesn't setPos() work to position a dialog box? Yes, you can set the original position with the realize(DB, x, y) command. Yes, you can dynamically change the position after its realized with the setPos(DB, x, y) command. This may come up in a callback or button. The following demonstrates it.
DB dB
void applyMoveIt(DB dbXX)
{
int x = 0, y = 0
getPos(dB, x, y)
if (x == 10)
setPos(dB, 200, 10)
else setPos(dB, 10, 200)
} // end applyMoveIt()
dB=topMost "hello world"
label(dB,"Why doubt me?")
apply(dB, "MoveIt", applyMoveIt)
realize(dB, 200, 200)
show dB
|
Re: Why doesn't setPos() work to position a dialog box? llandale - Wed Apr 08 14:07:53 EDT 2009 Yes, you can set the original position with the realize(DB, x, y) command. Yes, you can dynamically change the position after its realized with the setPos(DB, x, y) command. This may come up in a callback or button. The following demonstrates it.
DB dB
void applyMoveIt(DB dbXX)
{
int x = 0, y = 0
getPos(dB, x, y)
if (x == 10)
setPos(dB, 200, 10)
else setPos(dB, 10, 200)
} // end applyMoveIt()
dB=topMost "hello world"
label(dB,"Why doubt me?")
apply(dB, "MoveIt", applyMoveIt)
realize(dB, 200, 200)
show dB
Thanks Louie, I never knew that.
DB db = null
DBE dbeTimer = null
void doClock(DBE dbe)
{
setPos(db, random(900), random(600))
}
db = create(dbExplorer, "Catch", styleCentered)
label(db, "Catch me if you can!")
dbeTimer = timer(db, 1, doClock, "")
realize db
setCenteredSize(db, 200, 100)
show db
|
Re: Why doesn't setPos() work to position a dialog box? Tony_Goodman - Thu Apr 09 03:38:08 EDT 2009
Thanks Louie, I never knew that.
DB db = null
DBE dbeTimer = null
void doClock(DBE dbe)
{
setPos(db, random(900), random(600))
}
db = create(dbExplorer, "Catch", styleCentered)
label(db, "Catch me if you can!")
dbeTimer = timer(db, 1, doClock, "")
realize db
setCenteredSize(db, 200, 100)
show db
AAI Services, Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
Re: Why doesn't setPos() work to position a dialog box? Tony_Goodman - Thu Apr 09 03:38:08 EDT 2009
Thanks Louie, I never knew that.
DB db = null
DBE dbeTimer = null
void doClock(DBE dbe)
{
setPos(db, random(900), random(600))
}
db = create(dbExplorer, "Catch", styleCentered)
label(db, "Catch me if you can!")
dbeTimer = timer(db, 1, doClock, "")
realize db
setCenteredSize(db, 200, 100)
show db
Well, some years ago I came up with a silly notion of creating a status subordinate dialog box in the Library that displayed what was going on in the script when the user said go. Perhaps it would display which module the script was currently working on. I had this idea of this box figuring out where the master dialog box was and attaching itself to the bottom of it. This never worked well and I started just putting a separate status 'label' at the bottom of all my Dialogs (which, BTW, I had to initialize to 'A', and then erase it after the box was realized). >Louie |